/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pb138.xml.wrda.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;

/**
 *
 * @author Fufi
 */
@Controller
@RequestMapping("/")
public class HomeController {

    @RequestMapping("/")
    public ModelAndView show() throws Exception {
        return new ModelAndView("index");
    }

    @RequestMapping("/config")
    public void config(HttpServletResponse response) throws IOException {
        new File("repo/xsd").mkdirs();
        new File("repo/war").mkdir();
        new File("repo/wsdl").mkdir();

        response.sendRedirect("/");
    }
}
